package com.mall.shop.controller;

import com.mall.shop.entity.product.SkuInfo;
import com.mall.shop.service.SearchService;
import com.mall.shop.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    /**
     * 上架商品
     * @return R
     */
    @PostMapping("/statusUp")
    public R<Object> productStatusUp(@RequestBody List<SkuInfo> products) {
        boolean flag = searchService.productStatusUp(products);
        return R.ok(flag);
    }
}
